package com.lyf.mapper.admin;

import com.github.pagehelper.Page;
import com.lyf.dto.OrdersPageQueryDTO;
import com.lyf.pojo.Orders;
import com.lyf.pojo.OrderDetail;
import com.lyf.result.PageResult;
import com.lyf.vo.OrderDetailVO;
import com.lyf.vo.OrderStatisticsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
@Mapper
public interface OrderMapper {

    Page<Orders> pageQuery(OrdersPageQueryDTO ordersPageQueryDTO);

    OrderStatisticsVO statistics();

    void update(Orders orders);

    OrderDetailVO getOrderById(Long id);

    void insert(Orders orders);

    Orders getByNumber(String outTradeNo);

    Orders getById(Long id);

    @Select("select * from orders where status = #{status} and order_time < #{orderTime}")
    List<Orders> getByStatusAndOrderTime(Integer status, LocalDateTime orderTime);
}
